<?php

namespace App\Model;

use App\Model\BaseModel;
class CardCategoryModel extends BaseModel
{

    protected $table='card_category';
    public $timestamps  = false;
    protected $guarded = [];


    public function getTopicDate($cardId)
    {

        if(empty($cardId)){
            $res =  CardCategoryModel::get();
            if($res){
                return ['code' => true,'data' => $res -> makeHidden(['updated_at','created_at']) ];
            }else{
                return ['code' => false,'data' => '数据为空！'];
            }
        }else{
            $res =  CardCategoryModel::find($cardId);

            if($res){
                return ['code' => true,'data' => $res -> makeHidden(['updated_at','created_at']) ];
            }else{
                return ['code' => false,'data' => '数据为空！'];
            }
        }


    }




}
